import type { App } from "vue";
import SvgIcon from "./index.vue";
import "virtual:svg-icons-register";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
import "element-plus/dist/index.css";

const svgIconPlugin = {
  install(app: App): void {
    // vite-plugin-svg-icons
    app.component("svg-icon", SvgIcon);
    // @element-plus/icons-vue
    for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
      app.component(key, component);
    }
  }
};

export default svgIconPlugin;
